﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Foolproof;
using Lari.Configuration;

namespace Lari.Services.ViewModel
{
    public class UserProfileModel
    {
        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(100, ErrorMessage = "Must be at least 6 characters long and not more than 100.", MinimumLength = 6)]
        public String HintQuestion1 { get; set; }

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(100, ErrorMessage = "Must be at least 6 characters long and not more than 100.", MinimumLength = 6)]
        public String HintQuestion2 { get; set; }

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(100, ErrorMessage = "Must be at least 6 characters long and not more than 100.", MinimumLength = 6)]
        public String HintQuestion3 { get; set; }

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(100, ErrorMessage = "Must be at least 4 characters long and not more than 100.", MinimumLength = 4)]
        public String HintAnswer1 { get; set; }

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(100, ErrorMessage = "Must be at least 4 characters long and not more than 100.", MinimumLength = 4)]
        public String HintAnswer2 { get; set; }

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(100, ErrorMessage = "Must be at least 4 characters long and not more than 100.", MinimumLength = 4)]
        public String HintAnswer3 { get; set; }

        public string UserId { get; set; }
        

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(20, ErrorMessage = "Must be at least 8 characters long and not more than 20.", MinimumLength = 8)]
        public string OldPassword { get; set; }

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [NotEqualTo("OldPassword",ErrorMessage = "Old Password and New Password are same.")]
        [StringLength(20, ErrorMessage = "Must be at least 8 characters long and not more than 20.", MinimumLength = 8)]
        public string NewPassword { get; set; }
        
        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(20, ErrorMessage = "Must be at least 8 characters long and not more than 20.", MinimumLength = 8)]
        [Compare("NewPassword", ErrorMessage = "New Passwords must match")]
        public string ConfirmPassword { get; set; }
    }
}
